<html>
<head><meta charset="utf-8"><title>cbindgen as client? · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/cbindgen.20as.20client.3F.html">cbindgen as client?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="159936524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/cbindgen%20as%20client%3F/near/159936524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/cbindgen.20as.20client.3F.html#159936524">(Mar 04 2019 at 18:22)</a>:</h4>
<p>hey just popping in to see if cbindgen's usecase is at all interesting to this project. It needs to slurp up a crate and its dependencies to generate a C header for all the <code>pub extern "C" fns</code>, including resolving the definitions of any type referenced in that function's signatures. It currently does path resolution in a "basically-works but ultimately breakable and adhoc" way. As a result I(?) need to put in some work to teach it how to resolve Rust 2018 modules, which is a bummer since, ideally, something like this project should be solving that problem for us.</p>



<a name="159937716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/cbindgen%20as%20client%3F/near/159937716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/cbindgen.20as.20client.3F.html#159937716">(Mar 04 2019 at 18:37)</a>:</h4>
<p>Long term, yes. Short/medium term, likely no: we need to implement a ton of stuff before path resolution works reliably (macros being a significant contributor to the stuff).</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>